<?php
namespace tasks\demo\tool;

class TimeByCache
{
    private $time = 0 ;
    
    /**
     * 延后几秒
     * @var long
     */
    private $layzTime = 0; 
    
    public function __construct($time, $layzTime)
    {
        $this->time = $time;
        
        $this->layzTime = $layzTime*1000;
    }
    
    protected function lessCurrentTime ()
    {
        $time = $this->time + $this->layzTime;
        
        return $time - time();
    }
    
    public function isItOverdue ()
    {
        return $this->lessCurrentTime() < 0 ? true : false;
    }
}